Bulk Insert Example, using an IDataReader To Strong DataSet to Sql Server XML

Here is a sample I wrote that someone requested I post.
 
Right click HERE and do a "Save As" or "Save Target As".
 
 
The sample gets an IDataReader on a Source Datastore (Access/Jet database), populates a strong dataset, then after so many records, ships the DataSet.GetXml() to a sql server stored procedure.
This should run faster than doing a row by row get/insert that alot of people code up.
 
Yes, there are many ways to do bulk inserts/imports with Sql Server.  I chose this one because in my real life code, I need to run the rows through some business rules before importing. 
 
Enjoy.
 
This entry was posted in Software Development. Bookmark the permalink.

Leave a comment